<html>
<head><meta charset="utf-8"><title>Executer · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html">Executer</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="208678872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208678872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208678872">(Sep 01 2020 at 12:18)</a>:</h4>
<p>Hi, I found a Executer in the cargo core codebase. I would like to create a executer to use some special features of my linux distro. How can I do that. How can I change the executer used?</p>



<a name="208687230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208687230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208687230">(Sep 01 2020 at 13:33)</a>:</h4>
<p>I am not sure what you mean by "Executer". There are env vars for setting a runner or as a way to wrap rustc. Is that what you mean?</p>



<a name="208697544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208697544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208697544">(Sep 01 2020 at 14:48)</a>:</h4>
<p><span class="user-mention" data-user-id="120179">@Eh2406</span>  I mean this Executer trait: <a href="https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/mod.rs#L65-L88">https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/mod.rs#L65-L88</a></p>



<a name="208697766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208697766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208697766">(Sep 01 2020 at 14:49)</a>:</h4>
<p>Where is this env var? did not find anything about that var yet.</p>



<a name="208697971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208697971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208697971">(Sep 01 2020 at 14:50)</a>:</h4>
<p>Note that <code>Executor</code> ≠ <code>Executer</code></p>



<a name="208698043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208698043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208698043">(Sep 01 2020 at 14:51)</a>:</h4>
<p>It might be a good idea if you expand on what you want to do. <a href="http://xyproblem.info/">X-Y problem</a></p>



<a name="208698399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208698399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208698399">(Sep 01 2020 at 14:53)</a>:</h4>
<p>Yeah, so I want to use the nix build system to build cargo projects. For this I would need to call nix, instead of rustc. What I hope to archive is that nix can build rust software much faster, as it then can cache crates, instead of rebuilding everything everytime</p>



<a name="208698447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208698447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208698447">(Sep 01 2020 at 14:53)</a>:</h4>
<p><code>RUSTC_WRAPPER</code> or looking up the other I had inmined ...</p>



<a name="208698705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208698705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208698705">(Sep 01 2020 at 14:55)</a>:</h4>
<p><a href="https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner">https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner</a></p>



<a name="208698935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208698935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208698935">(Sep 01 2020 at 14:56)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/246057-t-cargo/topic/Executer/near/208698447">said</a>:</p>
<blockquote>
<p><code>RUSTC_WRAPPER</code> or looking up the other I had inmined ...</p>
</blockquote>
<p>This could work, but I have to generate some files for nix to work. unsure if cargo wants to support better nix building?</p>



<a name="208699191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208699191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208699191">(Sep 01 2020 at 14:58)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/246057-t-cargo/topic/Executer/near/208698705">said</a>:</p>
<blockquote>
<p><a href="https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner">https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner</a></p>
</blockquote>
<p>This will not help, as I want to change the build steps, not the execute steps</p>



<a name="208699623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208699623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208699623">(Sep 01 2020 at 15:01)</a>:</h4>
<blockquote>
<p>unsure if cargo wants to support better nix building?</p>
</blockquote>
<p>In general yes, but what we want to merge depends on a lot of details. like if it is infrastructure that can be reused by other build systems, and maintenance berden and sutch.</p>



<a name="208700043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208700043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208700043">(Sep 01 2020 at 15:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/246057-t-cargo/topic/Executer/near/208699623">said</a>:</p>
<blockquote>
<blockquote>
<p>unsure if cargo wants to support better nix building?</p>
</blockquote>
<p>In general yes, but what we want to merge depends on a lot of details. like if it is infrastructure that can be reused by other build systems, and maintenance berden and sutch.</p>
</blockquote>
<p>sounds good. But then I'm back to my question from the beginnig :-)<br>
Is there something yet for not using <code>DefaultExecutor</code>?<br>
This would help me to just try to implement something, and if I get it to work, we can talk about upstreaming</p>



<a name="208701399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208701399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208701399">(Sep 01 2020 at 15:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/246057-t-cargo/topic/Executer/near/208698447">said</a>:</p>
<blockquote>
<p><code>RUSTC_WRAPPER</code> or looking up the other I had inmined ...</p>
</blockquote>
<p>Seems like that does not help, as is only executed for files in the own crate?<br>
I will have to figure out how cargo builds dependency crates</p>



<a name="208701857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208701857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208701857">(Sep 01 2020 at 15:15)</a>:</h4>
<p>I think there is a new one for that problem, it may still be unstable. I am looking for it...</p>



<a name="208703787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208703787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208703787">(Sep 01 2020 at 15:26)</a>:</h4>
<p><code>RUSTC_WORKSPACE_WRAPPER</code> cc <a href="https://github.com/rust-lang/cargo/pull/7533">https://github.com/rust-lang/cargo/pull/7533</a></p>



<a name="208704693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208704693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208704693">(Sep 01 2020 at 15:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/246057-t-cargo/topic/Executer/near/208703787">said</a>:</p>
<blockquote>
<p><code>RUSTC_WORKSPACE_WRAPPER</code> cc <a href="https://github.com/rust-lang/cargo/pull/7533">https://github.com/rust-lang/cargo/pull/7533</a></p>
</blockquote>
<p>Thanks. But that would create the need of an external program again</p>



<a name="208705806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208705806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208705806">(Sep 01 2020 at 15:39)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/246057-t-cargo/topic/Executer/near/208703787">said</a>:</p>
<blockquote>
<p><code>RUSTC_WORKSPACE_WRAPPER</code> cc <a href="https://github.com/rust-lang/cargo/pull/7533">https://github.com/rust-lang/cargo/pull/7533</a></p>
</blockquote>
<p>Seems also wrong. This seems to be for workspaces. I want to change the buildstep for libraries downloaded from <a href="http://crates.io">crates.io</a> (best would be, if I could even stop cargo downloading it)</p>



<a name="208706421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208706421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208706421">(Sep 01 2020 at 15:43)</a>:</h4>
<p>I think <code>RUSTC_WRAPPER</code> works that way. It is used for <code>sccache</code> to cache the <a href="http://crates.io">crates.io</a> dependency.</p>



<a name="208706636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208706636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208706636">(Sep 01 2020 at 15:45)</a>:</h4>
<p>Then it seems broken. I echoed everything into a file, but I can only see rustc calls for local files</p>



<a name="208706938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208706938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208706938">(Sep 01 2020 at 15:47)</a>:</h4>
<p>From a clean build?</p>



<a name="208707295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208707295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208707295">(Sep 01 2020 at 15:50)</a>:</h4>
<p>No, stable installed via rustup. Will try a clean build later. Forgot that I can do that now ;-)</p>



<a name="208707598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208707598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208707598">(Sep 01 2020 at 15:52)</a>:</h4>
<p>I did not mean a clean install. Just ment, "cargo clean" then "cargo build". <br>
Or "cargo build" in a project with no <code>target</code> dir yet.</p>



<a name="208708207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208708207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208708207">(Sep 01 2020 at 15:56)</a>:</h4>
<p>Yes, I did a cargo clean and then cargo build (with env vars set). Did not check for the target dir</p>



<a name="208714686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208714686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208714686">(Sep 01 2020 at 16:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="322844">Finn Behrens</span> <a href="#narrow/stream/246057-t-cargo/topic/Executer/near/208698399">said</a>:</p>
<blockquote>
<p>Yeah, so I want to use the nix build system to build cargo projects. For this I would need to call nix, instead of rustc. What I hope to archive is that nix can build rust software much faster, as it then can cache crates, instead of rebuilding everything everytime</p>
</blockquote>
<p>There is an existing group of people that already use nix to build Rust projects, including some compiler developers. Have you looked into what these people do instead of rolling your own?</p>



<a name="208714908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208714908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208714908">(Sep 01 2020 at 16:42)</a>:</h4>
<p>Did not find that group specifically. I only know of 3 projects, one very unstable, one separate but not caching, and the third as buildRustPackage from nixpkgs</p>



<a name="208715720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Executer/near/208715720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Executer.html#208715720">(Sep 01 2020 at 16:49)</a>:</h4>
<p>So what I want to build in the long run is a rust packager using recursive nix</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>